﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/MasterAdmin.master" AutoEventWireup="true"
    CodeFile="ListCustomers.aspx.cs" Inherits="Admin_LitsCustomers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <h1>
        List Customers</h1>
    <asp:ListView ID="ListView1" runat="server" DataKeyNames="UserId" DataSourceID="SqlDataSource1">
        <AlternatingItemTemplate>
            <tr style="background-color: #FFFFFF;color: #284775;">
                <td>
                    <asp:Label ID="UserIdLabel" runat="server" Text='<%# Eval("UserId") %>' />
                </td>
                <td>
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                </td>
                <td>
                    <asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>' />
                </td>
                <td>
                    <asp:Label ID="CreateDateLabel" runat="server" 
                        Text='<%# Eval("CreateDate") %>' />
                </td>
                <td>
                    <asp:Label ID="LastLoginDateLabel" runat="server" 
                        Text='<%# Eval("LastLoginDate") %>' />
                </td>
                <td>
                    <asp:Label ID="LastPasswordChangedDateLabel" runat="server" 
                        Text='<%# Eval("LastPasswordChangedDate") %>' />
                </td>
                <td>
                    <asp:CheckBox ID="IsApprovedCheckBox" runat="server" 
                        Checked='<%# Eval("IsApproved") %>' Enabled="false" />
                </td>
            </tr>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <tr style="background-color: #999999;">
                <td>
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                </td>
                <td>
                    <asp:Label ID="UserIdLabel1" runat="server" Text='<%# Eval("UserId") %>' />
                </td>
                <td>
                    <asp:TextBox ID="UserNameTextBox" runat="server" 
                        Text='<%# Bind("UserName") %>' />
                </td>
                <td>
                    <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
                </td>
                <td>
                    <asp:TextBox ID="CreateDateTextBox" runat="server" 
                        Text='<%# Bind("CreateDate") %>' />
                </td>
                <td>
                    <asp:TextBox ID="LastLoginDateTextBox" runat="server" 
                        Text='<%# Bind("LastLoginDate") %>' />
                </td>
                <td>
                    <asp:TextBox ID="LastPasswordChangedDateTextBox" runat="server" 
                        Text='<%# Bind("LastPasswordChangedDate") %>' />
                </td>
                <td>
                    <asp:CheckBox ID="IsApprovedCheckBox" runat="server" 
                        Checked='<%# Bind("IsApproved") %>' />
                </td>
            </tr>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <table runat="server" 
                style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                <tr>
                    <td>
                        No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <tr style="">
                <td>
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                </td>
                <td>
                    <asp:TextBox ID="UserIdTextBox" runat="server" Text='<%# Bind("UserId") %>' />
                </td>
                <td>
                    <asp:TextBox ID="UserNameTextBox" runat="server" 
                        Text='<%# Bind("UserName") %>' />
                </td>
                <td>
                    <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
                </td>
                <td>
                    <asp:TextBox ID="CreateDateTextBox" runat="server" 
                        Text='<%# Bind("CreateDate") %>' />
                </td>
                <td>
                    <asp:TextBox ID="LastLoginDateTextBox" runat="server" 
                        Text='<%# Bind("LastLoginDate") %>' />
                </td>
                <td>
                    <asp:TextBox ID="LastPasswordChangedDateTextBox" runat="server" 
                        Text='<%# Bind("LastPasswordChangedDate") %>' />
                </td>
                <td>
                    <asp:CheckBox ID="IsApprovedCheckBox" runat="server" 
                        Checked='<%# Bind("IsApproved") %>' />
                </td>
            </tr>
        </InsertItemTemplate>
        <ItemTemplate>
            <tr style="background-color: #E0FFFF;color: #333333;">
                <td>
                    <asp:Label ID="UserIdLabel" runat="server" Text='<%# Eval("UserId") %>' />
                </td>
                <td>
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                </td>
                <td>
                    <asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>' />
                </td>
                <td>
                    <asp:Label ID="CreateDateLabel" runat="server" 
                        Text='<%# Eval("CreateDate") %>' />
                </td>
                <td>
                    <asp:Label ID="LastLoginDateLabel" runat="server" 
                        Text='<%# Eval("LastLoginDate") %>' />
                </td>
                <td>
                    <asp:Label ID="LastPasswordChangedDateLabel" runat="server" 
                        Text='<%# Eval("LastPasswordChangedDate") %>' />
                </td>
                <td>
                    <asp:CheckBox ID="IsApprovedCheckBox" runat="server" 
                        Checked='<%# Eval("IsApproved") %>' Enabled="false" />
                </td>
            </tr>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table id="itemPlaceholderContainer" runat="server" border="1" 
                            style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <tr runat="server" style="background-color: #E0FFFF;color: #333333;">
                                <th runat="server">
                                    UserId</th>
                                <th runat="server">
                                    UserName</th>
                                <th runat="server">
                                    Email</th>
                                <th runat="server">
                                    CreateDate</th>
                                <th runat="server">
                                    LastLoginDate</th>
                                <th runat="server">
                                    LastPasswordChangedDate</th>
                                <th runat="server">
                                    IsApproved</th>
                            </tr>
                            <tr runat="server" ID="itemPlaceholder">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" 
                        style="text-align: center;background-color: #5D7B9D;font-family: Verdana, Arial, Helvetica, sans-serif;color: #FFFFFF">
                        <asp:DataPager ID="DataPager1" runat="server">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                    ShowLastPageButton="True" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <tr style="background-color: #E2DED6;font-weight: bold;color: #333333;">
                <td>
                    <asp:Label ID="UserIdLabel" runat="server" Text='<%# Eval("UserId") %>' />
                </td>
                <td>
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                </td>
                <td>
                    <asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>' />
                </td>
                <td>
                    <asp:Label ID="CreateDateLabel" runat="server" 
                        Text='<%# Eval("CreateDate") %>' />
                </td>
                <td>
                    <asp:Label ID="LastLoginDateLabel" runat="server" 
                        Text='<%# Eval("LastLoginDate") %>' />
                </td>
                <td>
                    <asp:Label ID="LastPasswordChangedDateLabel" runat="server" 
                        Text='<%# Eval("LastPasswordChangedDate") %>' />
                </td>
                <td>
                    <asp:CheckBox ID="IsApprovedCheckBox" runat="server" 
                        Checked='<%# Eval("IsApproved") %>' Enabled="false" />
                </td>
            </tr>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        
        SelectCommand="SELECT * FROM [vw_aspnet_Customers] WHERE ([RoleName] = @RoleName)">
        <SelectParameters>
            <asp:Parameter DefaultValue="Customer" Name="RoleName" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
